-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(manage): show progress in 'update all' button #1333
Conversation
d-loose
commented
Aug 15, 2023
- Disable refresh button when an update is in progress
- Disable 'update all' button while checking for updates
- Show progress indicator in the 'update all' button during an update (similar to the primary action button on the detail page)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏽
My questions are more for my own learning.
lib/src/manage/manage_page.dart
Outdated
onPressed: ref.read(updatesModelProvider).refresh, | ||
onPressed: updatesModel.activeChangeId != null | ||
? null | ||
: ref.read(updatesModelProvider).refresh, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honest question: you cannot reuse the updatesModel
local variable because it was created with ref.watch
, can you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you totally can, thanks for spotting!
It's just a force of habit to always use read
when calling methods on a provider
child: updatesModel.activeChangeId != null | ||
? Consumer( | ||
builder: (context, ref, child) { | ||
final change = ref |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another honest question: change
can never be null if updatesModel.activeChangeId
is not null, can it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to double check my understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's null
while the changeProvider
, which gives an AsyncValue<SnapdChange>
, is fetching the data from snapd
* move snap l10n extensions into separate file * show change progress in 'update all' button * update tests, leave todo notes * add 'updating' l10n string * re-use updatesModel
* move snap l10n extensions into separate file * show change progress in 'update all' button * update tests, leave todo notes * add 'updating' l10n string * re-use updatesModel
* move snap l10n extensions into separate file * show change progress in 'update all' button * update tests, leave todo notes * add 'updating' l10n string * re-use updatesModel
* move snap l10n extensions into separate file * show change progress in 'update all' button * update tests, leave todo notes * add 'updating' l10n string * re-use updatesModel